org.eclipse.vtp.framework.interactions.voice.vxml
Class VXMLDocument

java.lang.Object
  extended by org.eclipse.vtp.framework.interactions.core.support.Widget
      extended by org.eclipse.vtp.framework.interactions.core.support.WidgetDocument
          extended by org.eclipse.vtp.framework.interactions.voice.vxml.VXMLDocument
All Implemented Interfaces:
IDocument, VXMLConstants

public class VXMLDocument
extends WidgetDocument
implements VXMLConstants

Document type for VXML widgets.

Version:
2.0
Author:
Trip Gilman, Lonnie Pryor

Field Summary
 
Fields inherited from interface org.eclipse.vtp.framework.interactions.voice.vxml.VXMLConstants
EMPTY, FILE_EXT_GSL, FILLED_MODE_ALL, FILLED_MODE_ANY, GRAMMAR_MODE_DTMF, GRAMMAR_MODE_VOICE, METHOD_GET, METHOD_POST, MIME_TYPE_GSL, MIME_TYPE_SRGS, NAME_APPLICATION, NAME_ASSIGN, NAME_AUDIO, NAME_BARGEIN, NAME_BEEP, NAME_BLOCK, NAME_BRIDGE, NAME_CATCH, NAME_CHOICE, NAME_COMPLETETIMEOUT, NAME_COND, NAME_CONFIDENCELEVEL, NAME_COUNT, NAME_DEST, NAME_DISCONNECT, NAME_DTMF, NAME_DTMFTERM, NAME_ELSE, NAME_ELSEIF, NAME_ENCTYPE, NAME_ENUMERATE, NAME_ERROR, NAME_EVENT, NAME_EVENTEXPR, NAME_EXIT, NAME_EXPR, NAME_FIELD, NAME_FILLED, NAME_FINALSILENCE, NAME_FORM, NAME_GOTO, NAME_GRAMMAR, NAME_ID, NAME_IF, NAME_INCOMPLETETIMEOUT, NAME_INPUTMODES, NAME_INTERDIGITTIMEOUT, NAME_ITEM, NAME_MAXNBEST, NAME_MAXSPEECHTIMEOUT, NAME_MAXTIME, NAME_MENU, NAME_METHOD, NAME_MODE, NAME_NAME, NAME_NAMELIST, NAME_NEXT, NAME_NOINPUT, NAME_NOMATCH, NAME_ONE_OF, NAME_OPTION, NAME_PARAM, NAME_PROMPT, NAME_PROPERTY, NAME_RECORD, NAME_REPEAT, NAME_REPROMPT, NAME_RETURN, NAME_ROOT, NAME_RULE, NAME_SCOPE, NAME_SCRIPT, NAME_SENSITIVITY, NAME_SPEEDVSACCURACY, NAME_SRC, NAME_SUBDIALOG, NAME_SUBMIT, NAME_TERMCHAR, NAME_TERMTIMEOUT, NAME_THROW, NAME_TIMEOUT, NAME_TRANSFER, NAME_TYPE, NAME_VALUE, NAME_VAR, NAME_VERSION, NAME_VXML, NAMESPACE_URI_VXML, QNAME_XML_LANG, SCOPE_DIALOG, SCOPE_DOCUMENT, TYPE_CDATA, VERSION_2_0
 
Fields inherited from interface org.eclipse.vtp.framework.interactions.core.platforms.IDocument
DEFAULT_CONTENT_TYPE
 
Constructor Summary
VXMLDocument()
          Creates a new VXMLDocument object.
VXMLDocument(java.lang.String version)
          Creates a new VXMLDocument object.
 
Method Summary
 void addDialog(Dialog dialog)
          Adds a dialog to this document.
 void addEventHandler(EventHandler eventHandler)
          Adds an event handler to this document.
 void addScript(Script script)
          Adds a script block to this document.
 void addVariable(Variable variable)
          Adds a variable to this document.
 void clearProperty(java.lang.String propertyName)
          Clears the value of a property in this document.
 java.lang.String getApplicationURI()
          Returns the application URI of this document or null if no URI is specified.
 java.lang.String getDocumentType()
          Returns a string representing the dialect of XML document this instance produces.
 java.lang.String[] getPropertyNames()
          Returns the names of the properties of this document.
 java.lang.String getPropertyValue(java.lang.String propertyName)
          Returns the value of the specified property or null if no such property exists.
 java.lang.String getVersion()
          Returns the version of VXML this document conforms to.
 void removeDialog(Dialog dialog)
          Removes a dialog from this document.
 void removeEventHandler(EventHandler eventHandler)
          Removes an event handler from this document.
 void removeScript(Script script)
          Removes a script block from this document.
 void removeVariable(Variable variable)
          Removes a variable from this document.
 void setApplicationURI(java.lang.String applicationURI)
          Sets the application URI of this document.
 void setProperty(java.lang.String propertyName, java.lang.String propertyValue)
          Sets the value of a property in this document.
 void setVersion(java.lang.String version)
          Sets the version of VXML this document conforms to.
protected  void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
          Write the attribute members of this variable to the supplied set.
protected  void writeDialogs(org.xml.sax.ContentHandler outputHandler)
          Write the dialogs of this document to the specified content handler.
protected  void writeEventHandlers(org.xml.sax.ContentHandler outputHandler)
          Write the event handlers of this document to the specified content handler.
protected  void writeProperties(org.xml.sax.ContentHandler outputHandler)
          Writes the properties of this document to the specified content handler.
protected  void writeScripts(org.xml.sax.ContentHandler outputHandler)
          Write the scripts of this document to the specified content handler.
protected  void writeVariables(org.xml.sax.ContentHandler outputHandler)
          Write the variables of this document to the specified content handler.
 void writeWidget(org.xml.sax.ContentHandler outputHandler)
          Writes the content of this widget to an XML content handler.
 
Methods inherited from class org.eclipse.vtp.framework.interactions.core.support.WidgetDocument
getContentType, toXMLSource
 
Methods inherited from class org.eclipse.vtp.framework.interactions.core.support.Widget
toString, writeAttribute, writeChildren, writeChildren, writeWidget, writeWidget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VXMLDocument

public VXMLDocument()
Creates a new VXMLDocument object.


VXMLDocument

public VXMLDocument(java.lang.String version)
             throws java.lang.NullPointerException
Creates a new VXMLDocument object.

Parameters:
version - The version of VXML this document conforms to.
Throws:
java.lang.NullPointerException - If the version string is null.
Method Detail

getVersion

public java.lang.String getVersion()
Returns the version of VXML this document conforms to.

Returns:
The version of VXML this document conforms to.

getApplicationURI

public java.lang.String getApplicationURI()
Returns the application URI of this document or null if no URI is specified.

Returns:
The application URI of this document or null if no URI is specified.

getPropertyNames

public java.lang.String[] getPropertyNames()
Returns the names of the properties of this document.

Returns:
The names of the properties of this document.

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String propertyName)
                                  throws java.lang.NullPointerException
Returns the value of the specified property or null if no such property exists.

Parameters:
propertyName - The name of the property to find the value of.
Returns:
The value of the specified property or null if no such property exists.
Throws:
java.lang.NullPointerException - If the supplied property name is null.

setVersion

public void setVersion(java.lang.String version)
Sets the version of VXML this document conforms to.

Parameters:
version - The version of VXML this document conforms to.
Throws:
java.lang.NullPointerException - If the version string is null.

setApplicationURI

public void setApplicationURI(java.lang.String applicationURI)
Sets the application URI of this document.

Parameters:
applicationURI - The application URI of this document.

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.String propertyValue)
                 throws java.lang.NullPointerException
Sets the value of a property in this document.

Parameters:
propertyName - The name of the property to set.
propertyValue - The value to set the property to.
Throws:
java.lang.NullPointerException - If the supplied property name or value is null.

clearProperty

public void clearProperty(java.lang.String propertyName)
                   throws java.lang.NullPointerException
Clears the value of a property in this document.

Parameters:
propertyName - The name of the property to clear.
Throws:
java.lang.NullPointerException - If the supplied property name is null.

addVariable

public void addVariable(Variable variable)
                 throws java.lang.NullPointerException
Adds a variable to this document.

Parameters:
variable - The variable to add.
Throws:
java.lang.NullPointerException - If the supplied variable is null.

removeVariable

public void removeVariable(Variable variable)
                    throws java.lang.NullPointerException
Removes a variable from this document.

Parameters:
variable - The variable to remove.
Throws:
java.lang.NullPointerException - If the supplied variable is null.

addScript

public void addScript(Script script)
               throws java.lang.NullPointerException
Adds a script block to this document.

Parameters:
script - The script block to add.
Throws:
java.lang.NullPointerException - If the supplied script block is null.

removeScript

public void removeScript(Script script)
                  throws java.lang.NullPointerException
Removes a script block from this document.

Parameters:
script - The script block to remove.
Throws:
java.lang.NullPointerException - If the supplied script block is null.

addDialog

public void addDialog(Dialog dialog)
               throws java.lang.NullPointerException
Adds a dialog to this document.

Parameters:
dialog - The dialog to add.
Throws:
java.lang.NullPointerException - If the supplied dialog is null.

removeDialog

public void removeDialog(Dialog dialog)
                  throws java.lang.NullPointerException
Removes a dialog from this document.

Parameters:
dialog - The dialog to remove.
Throws:
java.lang.NullPointerException - If the supplied dialog is null.

addEventHandler

public void addEventHandler(EventHandler eventHandler)
                     throws java.lang.NullPointerException
Adds an event handler to this document.

Parameters:
eventHandler - The event handler to add.
Throws:
java.lang.NullPointerException - If the supplied event handler is null.

removeEventHandler

public void removeEventHandler(EventHandler eventHandler)
                        throws java.lang.NullPointerException
Removes an event handler from this document.

Parameters:
eventHandler - The event handler to remove.
Throws:
java.lang.NullPointerException - If the supplied event handler is null.

getDocumentType

public java.lang.String getDocumentType()
Description copied from interface: IDocument
Returns a string representing the dialect of XML document this instance produces.

Specified by:
getDocumentType in interface IDocument
Returns:
A string representing the dialect of XML document this instance produces.

writeWidget

public void writeWidget(org.xml.sax.ContentHandler outputHandler)
                 throws java.lang.NullPointerException,
                        org.xml.sax.SAXException
Description copied from class: Widget
Writes the content of this widget to an XML content handler.

Specified by:
writeWidget in class Widget
Parameters:
outputHandler - The handler to write this widget to.
Throws:
java.lang.NullPointerException - If the supplied content handler is null.
org.xml.sax.SAXException - If the writing of this widget fails.

writeAttributes

protected void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
Write the attribute members of this variable to the supplied set.

Parameters:
attributes - The attribute set to write to.
Throws:
java.lang.NullPointerException - If the supplied attribute set is null.

writeProperties

protected void writeProperties(org.xml.sax.ContentHandler outputHandler)
                        throws java.lang.NullPointerException,
                               org.xml.sax.SAXException
Writes the properties of this document to the specified content handler.

Parameters:
outputHandler - The handler to write the properties to.
Throws:
org.xml.sax.SAXException - If the writing of the properties fails.
java.lang.NullPointerException - If the supplied content handler is null.

writeVariables

protected void writeVariables(org.xml.sax.ContentHandler outputHandler)
                       throws java.lang.NullPointerException,
                              org.xml.sax.SAXException
Write the variables of this document to the specified content handler.

Parameters:
outputHandler - The content handler to write to.
Throws:
java.lang.NullPointerException - If the supplied content handler is null.
org.xml.sax.SAXException - If the writing of one of the event handlers fails.

writeScripts

protected void writeScripts(org.xml.sax.ContentHandler outputHandler)
                     throws java.lang.NullPointerException,
                            org.xml.sax.SAXException
Write the scripts of this document to the specified content handler.

Parameters:
outputHandler - The content handler to write to.
Throws:
java.lang.NullPointerException - If the supplied content handler is null.
org.xml.sax.SAXException - If the writing of one of the event handlers fails.

writeDialogs

protected void writeDialogs(org.xml.sax.ContentHandler outputHandler)
                     throws java.lang.NullPointerException,
                            org.xml.sax.SAXException
Write the dialogs of this document to the specified content handler.

Parameters:
outputHandler - The content handler to write to.
Throws:
java.lang.NullPointerException - If the supplied content handler is null.
org.xml.sax.SAXException - If the writing of one of the event handlers fails.

writeEventHandlers

protected void writeEventHandlers(org.xml.sax.ContentHandler outputHandler)
                           throws java.lang.NullPointerException,
                                  org.xml.sax.SAXException
Write the event handlers of this document to the specified content handler.

Parameters:
outputHandler - The content handler to write to.
Throws:
java.lang.NullPointerException - If the supplied content handler is null.
org.xml.sax.SAXException - If the writing of one of the event handlers fails.